<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>transform,transition,@keyframes</title>
    <style>
        .box {
            position: relative;
            width: 100px;
            height: 100px;
            background: #ccc;
            box-shadow: 0 0 30px 10px;
            transform: rotateX(0deg);
            transform: rotateY(30deg);
            transform: skew(10deg);
            transform: scale(1.2, 1.5);
            transition: width 1s ease-in-out .3s, height .6s 1s;
            animation: spin 5s infinite linear;
        }

        .box:hover {
            width: 300px;
            height: 100px;

        }

        @keyframes spin {
            /*   0 {
    transform: rotateY(0);
  }
  50% {
    transform: rotateY(180deg);
  }
  100% {
    transform: rotateY(360deg);
  } */
            from {
                top: 0;
            }
            to {
                top: 200px;
            }
        }

        .box2 {
            position: relative;
            left: 300px;
            width: 100px;
            height: 100px;
            background: red;
            animation: bgcolor 5s infinite alternate;
        }

        @keyframes bgcolor {
            0% {
                background: red;
                left: 0;
                top: 0;
            }
            25% {
                background: yellow;
                left: 200px;
                top: 0;
            }
            50% {
                background: blue;
                left: 200px;
                top: 200px;
            }
            75% {
                background: green;
                left: 0;
                top: 200px;
            }
            100% {
                background: red;
                left: 0;
                top: 0;
            }
        }

        .box3 {
            width: 100px;
            height: 100px;
            margin: 0 auto;
            background: #888;
            transform: rotate(10deg);
        }

        .box4 {
            width: 100px;
            height: 100px;
            margin: 0 auto;
            background: pink;
            /*   扭曲变形 */
            transform: skew(10deg, 30deg);
        }

        .box5 {
            width: 100px;
            height: 100px;
            margin: 0 auto;
            background: greenyellow;
            transform: scale(1.2, .7);
        }

        .box6 {
            width: 100px;
            height: 100px;
            margin: 0 auto;
            background: deepskyblue;
            transform: translate(134px, 10px);
        }
    </style>
</head>

<body>
    <div class="box"></div>

    <div class="box2"></div>

    <div class="box3"></div>

    <div class="box4"></div>

    <div class="box5"></div>

    <div class="box6"></div>
</body>

</html>